package com.yiyue.graduate.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yiyue.graduate.dao.DiscussMapper;
import com.yiyue.graduate.pojo.Discuss;
import com.yiyue.graduate.service.DiscussService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author yiyuexiaofusheng
 * @date 2021/5/9
 */
@Service
public class DiscussServiceImpl implements DiscussService {

    @Resource
    DiscussMapper discussMapper;

    @Override
    public List<Discuss> getAllDiscuss() {
        return discussMapper.selectList(new QueryWrapper<Discuss>());
    }

    @Override
    public Discuss getDiscuss(Long id) {
        QueryWrapper<Discuss> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",id);
        return discussMapper.selectOne(queryWrapper);
    }
}
